package leetcode.weekly.week317;

//Solution1Test
public class Solution1 {

	public int averageValue(int[] nums) {
		int sum = 0, cnt = 0;
		for (int num : nums) {
			if ((num % 3 == 0) && ((num & 1) == 0)) {
				sum += num;
				cnt++;
			}
		}
		return cnt == 0 ? 0 : sum / cnt;
	}
}
